#include<iostream>
#include<thread>

class Obj
{
    public:
        Obj() {std::cout << "hello ";}
        ~Obj() {std::cout << "world\n";}
};
void joinWorker()
{
    Obj obj;
		std::this_thread::sleep_for(std::chrono::seconds(2));
}

int main()
{
    std::thread j(joinWorker);
    j.join(); 
		std::this_thread::sleep_for(std::chrono::seconds(1));  
		return 0;
}